/**********************************************************************************************
Step 0: Basic setup
**********************************************************************************************/


** Bring in the data
use "$DATA_OUT/NMDB_ASMB_respondents", clear
svyset [pweight = analysis_weight]

** Just keep NCD defaulters
keep if in_default_sample==1 & x27==2


/**********************************************************************************************
Step 1: Get results for NCD defaulters
**********************************************************************************************/


svy: tab EUW_or_disaster


** look at positive equity in ASMB
gen pos_eq_ASMB     = inlist(x51,1,2) // count ppl who owe significantly or slightly less than the property is worth
replace pos_eq_ASMB = 1 if inlist(x59,3,4) // count ppl who sold the property or paid off the loan

svy: tab pos_eq_ASMB


** Look at liquidity shocks among NCD defaulters
gen adverse_shock = x90a==1 | x90c==1 | x90f==1 | x90h==1 | x91a==1 | x91f==1 | x91g==1
svy: tab adverse_shock
svy: tab adverse_shock if EUW_or_disaster==0


